<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="Registration">

		<xsl:variable name="FORM_ID">
			<xsl:choose>
				<xsl:when test='/Registration/@gid'>EDIT_PHOTOENTRY</xsl:when>
				<xsl:otherwise>CREATE_PHOTOENTRY</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
  <div class="round_me" style="background:#EEC867; padding:10px;">

    <table class="body" border="0" cellspacing="0" cellpadding="0" width="100%" >
      <tr>
        <td bgcolor="#EEC867">


          <table bgcolor="#EEC867" class="body" border="0" cellspacing="2" cellpadding="0" width="100%">
            <form name="formRegistration" method="post" action="" onSubmit="validateGallery();return document.returnValue">
              <tr>
                <input type="hidden" name="FORM_ID" value="{$FORM_ID}"></input>
                <xsl:choose>
                  <xsl:when test='/Registration/@gid'>
                    <input type="hidden" name="gid" value="{/Registration/@gid}"></input>
                  </xsl:when>
                  <xsl:otherwise>
                  </xsl:otherwise>
                </xsl:choose>
                <td colspan="4">
                </td>
              </tr>

              <xsl:apply-templates/>

            </form>
          </table>

        </td>
      </tr>
    </table>
  </div>
</xsl:template>

<xsl:template match="box">
		<tr><td colspan="4" align="left">
<table bgcolor="#f4efdf" class="nbox" border="0" cellspacing="8" cellpadding="0" width="100%">
	<xsl:apply-templates/>
</table>
		</td></tr>
</xsl:template>

<xsl:template match="Question">
<xsl:choose>
	<xsl:when test='@Type="16"'>
		<xsl:variable name="next">
			<xsl:value-of select="@P1"/>
		</xsl:variable>
	</xsl:when>
	<xsl:when test='@Type="15"'>
		<tr><td colspan="4" align="center">
		<a href="{@P3}"><xsl:value-of select="@Description"/></a>
		<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="14"'>
		<tr><td colspan="4" align="center">
		<input id="SB{@ID}" name="SB{@ID}" onClick="javascript:link('{@P3}');" type="button" value="{@Description}"></input>
		<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="8" and not (/Registration/@gid &gt;0)'>
		<tr><td style="padding-top:10px;" colspan="4" align="center">
			<input type="submit" name="{concat('SUBMIT',@ID)}" value="{@Description}"></input><br/>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="8" and (/Registration/@gid &gt;0)'>
	</xsl:when>
	<xsl:when test='@Type="81" and /Registration/@gid &gt;0'>
		<tr><td style="padding-top:10px;" colspan="4" align="center">
			<input type="submit" name="{concat('SUBMIT',@ID)}" id="{concat('SUBMIT',@ID)}" value="{@Description}"></input><br/>
		</td></tr>
	</xsl:when>
	<xsl:when test='@Type="81" and not (/Registration/@gid &gt;0)'>
	</xsl:when>
	<xsl:when test='@Type="9"'>
		<tr><td colspan="4" align="center"><h4><xsl:value-of select="@Description"/></h4></td></tr>
	</xsl:when>
	<xsl:when test='@Type="10" and @P1="0"'>
		<tr><td colspan="4" align="left"><xsl:value-of select="@Comment"/></td></tr>
		<tr><td colspan="4" align="left"></td></tr>
	</xsl:when>
	<xsl:when test='@Type="10" and @P1="1"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><xsl:value-of select="@Comment"/></td></tr>
		<tr><td colspan="4" align="left"></td></tr>
	</xsl:when>
	<xsl:when test='@Type="41"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><input type="hidden" name="T{@ID}" value="{/Registration/@mprice}"></input>
			<img src="/imgs/girl.gif"/>&#160;<input disabled="true" type="text" name="{concat('TTT',@ID)}" size="5" maxlength="5" value="{/Registration/@mprice}"></input></td>
		</tr>
	</xsl:when>
	<xsl:when test='@Type="42"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td><input type="hidden" name="T{@ID}" value="{/Registration/@fprice}"></input>
			<img src="/imgs/boy.gif"/>&#160;<input disabled="true" type="text" name="{concat('TTT',@ID)}" size="5" maxlength="5" value="{/Registration/@fprice}"></input></td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="X1"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
				<div style="float:left;"><input type="text" name="{concat('T',@ID)}" size="22" maxlength="255" disabled="true" value="{/Registration/@name}"></input></div>
					<div style="float:left;padding-top:4px;">&#160;&#160;(<a href="?activityId={/Registration/@activityid}&amp;chooselid=1">Cambia locale!</a>)</div>
					<div style="padding-top:2px;">&#160;&#160;<a href="?activityId={/Registration/@activityid}&amp;nukelid=1"><img border="0" src="/imgs/delete.gif"/></a></div>
				</xsl:when>
				<xsl:otherwise>
				<input type="text" name="{concat('T',@ID)}" size="22" maxlength="255" disabled="true" value="Nessun locale selezionato!"></input>
					&#160;(<a href="?activityId={/Registration/@activityid}&amp;chooselid=1">Seleziona un locale!</a>)
				</xsl:otherwise>
			</xsl:choose>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="3"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<input type="hidden" id="{concat('gg',@ID)}" name="{concat('gg',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@gg}"></input>
		<input type="hidden" id="{concat('mm',@ID)}" name="{concat('mm',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@mm}"></input>
		<input type="hidden" id="{concat('aaaa',@ID)}" name="{concat('aaaa',@ID)}" class="form" size="4" maxlength="4" value="{/Registration/@aaaa}"></input>
		<nobr>
		<input disabled="true" type="text" id="{concat('ggg',@ID)}" name="{concat('ggg',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@gg}"></input>
		/
		<input disabled="true" type="text" id="{concat('mmm',@ID)}" name="{concat('mmm',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@mm}"></input>
		/
		<input disabled="true" type="text" id="{concat('aaaaa',@ID)}" name="{concat('aaaaa',@ID)}" class="form" size="4" maxlength="4" value="{/Registration/@aaaa}"></input>
		&#160;<span class="body_10px_red"><xsl:value-of select="@Comment"/></span></nobr>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="31"'>
		<tr>
		<td width="200px"><xsl:value-of select="@Description"/></td>
		<td align="right"></td>
		<td></td>
		<td>
		<nobr>
			<xsl:choose>
				<xsl:when test='string-length(/Registration/@hh)=1'>
					<input type="text" id="{concat('hh',@ID)}" name="{concat('hh',@ID)}" class="form" size="2" maxlength="2" value="{concat('0',/Registration/@hh)}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" id="{concat('hh',@ID)}" name="{concat('hh',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@hh}"></input>
				</xsl:otherwise>
			</xsl:choose>
		:
			<xsl:choose>
				<xsl:when test='string-length(/Registration/@mi)=1'>
					<input type="text" id="{concat('mi',@ID)}" name="{concat('mi',@ID)}" class="form" size="2" maxlength="2" value="{concat('0',/Registration/@mi)}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" id="{concat('mi',@ID)}" name="{concat('mi',@ID)}" class="form" size="2" maxlength="2" value="{/Registration/@mi}"></input>
				</xsl:otherwise>
			</xsl:choose>
		</nobr>
		<div class="body_10px_red"><xsl:value-of select="@Comment"/></div>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="5" and @ID="1"'>
		<tr>
		<td colspan="4">
			<div style="padding-bottom:5px;"><xsl:value-of select="@Description"/></div>
			<input  style="width:100%;" type="text" name="{concat('T',@ID)}" id="{concat('T',@ID)}" maxlength="{@P1}" value="{/Registration/@title}"></input>
		</td>
		</tr>
	</xsl:when>

	<xsl:when test='@Type="13" and @ID="3"'>
		<tr>
		<td colspan="4">
			<div style="padding-top:15px; padding-bottom:5px;"><xsl:value-of select="@Description"/></div>
			<TEXTAREA style="width:100%;" id="TA{@ID}" name="TA{@ID}" rows="{@P1}" convert_this="true"><xsl:value-of select="/Registration/@descr"/></TEXTAREA>

<div style="padding-top:10px;">
Keywords
<div style="padding-top:2px;"><TEXTAREA id="keywords" name="keywords" style="width:100%;" rows="2" cols="40"><xsl:for-each select="/Registration/keywords"><xsl:value-of select="@keyword"/>, </xsl:for-each></TEXTAREA></div>
<div class="shycomment">(Ogni <a style="text-decoration:underline; font-weight:bold; color:red;" href="/help/keywords.aspx">keyword</a> deve essere separata da una virgola, massimo 10 keyword)</div>
</div>

		</td>
		</tr>
	</xsl:when>

	<xsl:otherwise>
		<tr>
		<td width="200px">
		<xsl:value-of select="@Description"/>
		</td><td align="right">
		</td><td>

		</td>
		<td style="padding-top:10px;">

		<xsl:if test='@Type="2" and @ID="43"'>
			<table border="0">
			<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

			<xsl:choose>
			<xsl:when test='@P1="2"'>
				<xsl:for-each select="Answer">
					<tr>
						<xsl:choose>
						  <xsl:when test='not (/Registration/@radio) and @Default'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
						  <xsl:when test='@ID=/Registration/@categoryid'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
						  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
						</xsl:choose>
					<td class="body"><xsl:value-of select="."/><br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span></td>
					</tr>
				</xsl:for-each>
			</xsl:when>
			</xsl:choose>

			</table>
		</xsl:if>

		<xsl:if test='@Type="2" and @ID!="43"'>
			<table>
			<xsl:variable name="radioID" select="concat('R',@ID)"></xsl:variable>

			<xsl:choose>
			<xsl:when test='@P1="1"'>
				<tr>
				<xsl:for-each select="Answer">
					<xsl:choose>
					  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
					  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
					</xsl:choose>
					<td class="body"><xsl:value-of select="."/></td>
				</xsl:for-each>
				</tr>
			</xsl:when>
			<xsl:when test='@P1="2"'>
				<xsl:for-each select="Answer">
					<tr>
						<xsl:choose>
						  <xsl:when test='@ID=/Registration/@radio'><td><input type="radio" checked="yes" value="{@ID}" name="{$radioID}"></input></td></xsl:when>
						  <xsl:otherwise><td><input type="radio" value="{@ID}" name="{$radioID}"></input></td></xsl:otherwise>
						</xsl:choose>
					<td class="body"><xsl:value-of select="."/></td>
					</tr>
				</xsl:for-each>
			</xsl:when>
			</xsl:choose>

			</table>
		</xsl:if>

		<xsl:if test='@Type="7"'>
		<xsl:variable name="TMPID" select="@ID"></xsl:variable>
			<xsl:for-each select='Answer'>
			<table cellspacing="0" cellpadding="0">
				<xsl:if test='@Type="4"'>
					<tr><td><input type="text" name='SE{../@ID}' size="35" maxlength="64"></input></td></tr>
				</xsl:if>
				<xsl:if test='@Type="1"'>
					<tr><td>
					<select class="body" size="1" name="{concat('SD',@ID)}">
					<xsl:for-each select="SubAnswer">
					<option value="{@ID}"><xsl:value-of select="."/></option>
					</xsl:for-each>
					</select>
					</td></tr>
				</xsl:if>
			</table>
			</xsl:for-each>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="2"'>
		<input type="hidden" name="D{@ID}" value="{/Registration/@categoryid}"></input>
		<select disabled="true" class="body" size="1" name="DDD{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@categoryid'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="51"'>
		<select class="body" size="1" name="DDD{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@categoryid'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="43"'>
		<input type="hidden" name="D{@ID}" value="{/Registration/@categoryid}"></input>
		<select class="body" size="1" name="DDD{@ID}">
			<xsl:for-each select="Answer">
				<xsl:choose>
				  <xsl:when test='@ID=/Registration/@categoryid'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
				  <xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</select>
		</xsl:if>

		<xsl:if test='@Type="1" and @ID="4"'>
			<xsl:choose>
				<xsl:when test='/Registration/@place'>
						<input type="hidden" name="D{@ID}" value="{/Registration/@place}"></input>
						<select disabled="true" class="body" size="1" name="DDD{@ID}">
							<xsl:for-each select="Answer">
								<xsl:choose>
									<xsl:when test='@ID=/Registration/@place'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
									<xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</select>
				</xsl:when>
				<xsl:otherwise>
						<select class="body" size="1" name="D{@ID}">
							<xsl:for-each select="Answer">
								<xsl:choose>
									<xsl:when test='@ID=/Registration/@place'><option selected="selected" value="{@ID}"><xsl:value-of select="."/></option></xsl:when>
									<xsl:otherwise><option value="{@ID}"><xsl:value-of select="."/></option></xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</select>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>

		<xsl:if test='@Type="4"'>
			<input type="text" id="{concat('E',@ID)}" name="{concat('E',@ID)}" size="35" maxlength="64"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="5"'>
			<xsl:choose>
			<xsl:when test='@ID="44"'>
				<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@pwd}"></input>
			</xsl:when>
			<xsl:when test='@ID="9"'>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
					<input type="hidden" name="T{@ID}" value="{/Registration/@address}"></input>
					<input disabled="true" type="text" name="{concat('TTTT',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@address}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@address}"></input>
				</xsl:otherwise>
			</xsl:choose>
			</xsl:when>
			<xsl:when test='@ID="10"'>
			<xsl:choose>
				<xsl:when test='/Registration/@lid'>
					<input type="hidden" name="T{@ID}" value="{/Registration/@mapid}"></input>
					<input disabled="true" type="text" name="{concat('TTTT',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@mapid}"></input>
				</xsl:when>
				<xsl:otherwise>
					<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}" value="{/Registration/@mapid}"></input>
				</xsl:otherwise>
			</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<input type="text" name="{concat('T',@ID)}" size="{@P2}" maxlength="{@P1}"></input>
			</xsl:otherwise>
			</xsl:choose>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="11"'>
			<input type="text" ID="T{@ID}" name="NICK{@ID}" size="{@P2}" maxlength="{@P1}"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="12"'>
			<input type="password" ID="T{@ID}" name="PW{@ID}" size="{@P2}" maxlength="{@P1}"></input>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="13"'>
			<TEXTAREA id="TA{@ID}" name="TA{@ID}" rows="{@P1}" cols="{@P2}"></TEXTAREA>
			<br/><span class="body_10px_red"><xsl:value-of select="@Comment"/></span>
		</xsl:if>

		<xsl:if test='@Type="6"'>
			<img src="{@Comment}" border="1"/>
		</xsl:if>

		</td>
		</tr>
	</xsl:otherwise>
</xsl:choose>

</xsl:template>

</xsl:stylesheet>